/**
 * <p>Copyright: Copyright (c) 2012</p>
 * <p>Company: 联动优势科技有限公司</p>
 * <p>Aug 13, 2012 3:00:44 PM</p>
 * @author wangyunpeng
 * @version 1.0
 */
package com.ce.study.procum;

/** 
 * desc:
 * <p>创建人：wangyunpeng 创建日期：Aug 13, 2012 </p>
 * @version V1.0  
 */
public class Consumer extends Thread{
	private GoodsStock goodsStock;
	private String name;
	public Consumer(GoodsStock goodsStock, String name) {
		super(name);
		this.name = name;
		this.goodsStock = goodsStock;
	}

	/* 
	 * desc:
	 * (non-Javadoc)
	 * @see java.lang.Thread#run()
	 */
	@Override
	public void run() {
		while(true) {
			try {
				goodsStock.getGoods();
				sleep(100);
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}
	
	
}
